package com.seria.test01;

import java.io.FileOutputStream;
import java.io.ObjectOutputStream;

public class WriteInstance {
	public static void main(String[] args) throws Exception {
		if (args.length != 1) {
			//System.out.println("usage: java WriteInstance file");
			//System.exit(-1);
			args = new String[1];
			args[0] = new String("people");
		}
		FileOutputStream fos = new FileOutputStream(args[0]);
		ObjectOutputStream oos = new ObjectOutputStream(fos);
		Person p = new Person("gaoyanbing", "haiger");
		Person p1 = new Person("dylanHu", "kodak");
		oos.writeObject(p);
		oos.writeObject(p1);
		System.out.println(Person.getPopulation());
	}
}
